package com.eposi.eposigameinterface.adapter;

import org.andengine.entity.text.Text;

import com.eposi.eposigameinterface.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class FriendOnlineAdapter extends BaseAdapter {
	private Context ctx;
	LayoutInflater mInflater;
	public FriendOnlineAdapter(Context ctx) {
		this.ctx = ctx;
		mInflater = (LayoutInflater) ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	}
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return 20;
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		UserOnlineHolder holder = null;
		if (convertView == null) {
			holder = new UserOnlineHolder();
			convertView = mInflater.inflate(R.layout.list_user_item,null);
			holder.userImageLogo = (ImageView) convertView.findViewById(R.id.list_user_item_image_user);
			holder.userName = (TextView) convertView.findViewById(R.id.list_user_item_txt_user_name);
			holder.money= (TextView) convertView.findViewById(R.id.list_user_item_txt_money);
			holder.level= (TextView) convertView.findViewById(R.id.list_user_item_txt_level);
			convertView.setTag(holder);
		}else{
			holder = (UserOnlineHolder) convertView.getTag();
		}
		holder.userImageLogo.setImageResource(R.drawable.user_top_1);
		return convertView;
	}
	class UserOnlineHolder{
		ImageView userImageLogo;
		TextView userName;
		TextView money;
		TextView level;
		
	}
}
